package cn.kgc.boot.tcuser.mapper;

import cn.kgc.boot.tcuser.entity.UploadFileComment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author XMF
 * @date 2021-07-30 15:03
 **/
public interface UploadFileCommentMapper {

    @Select(value = "SELECT * FROM upload_file_comment WHERE delete_flag = 1 AND file_id = #{fileId} ORDER BY create_time DESC")
    List<UploadFileComment> queryFileCommentByFileId(@Param("fileId") Integer fileId);

    @Insert(value = "INSERT INTO upload_file_comment(comment_content, create_time, file_id)VALUE(#{u.commentContent}, #{u.createTime}, #{u.fileId})")
    int insertComment(@Param("u") UploadFileComment uploadFileComment);


}
